<template>
	<view v-if="datainfo!=null">
		<u-parse :html="datainfo.content"></u-parse>
		<view class="box">
			<view class="btn" @click="sureBtn">立即开通</view>
		</view>
	</view>
</template>

<script>
	import{combo}from"../../../api/product.js"
	import {mealList,sureBuy} from "../../../api/meal.js"
	export default{
		data(){
			return{
				id:null,
				datainfo:null
			}
		},
		onLoad(e) {
			this.id=e.id
			this.getinfo()
		},
		methods:{
			async getinfo(){
				let res=await this.post(combo,{
					user_id:uni.getStorageSync("userInfo").id,
					id:parseInt(this.id)
				})
				this.datainfo=res.data
			},
			sureBtn(){
				this.post(sureBuy,{
					user_id:uni.getStorageSync("userInfo").id,
					hgid:this.id
				}).then(res => {
					this.msg("激活成功")
					setTimeout(()=>{
						uni.navigateBack({
							delta:1
						})
					},1500)
				})
			}
		}
	}
</script>

<style>
	.box{
		width: 750rpx;
		height: 100rpx;
		background-color: #FFFFFF;
		position: fixed;
		bottom: 0;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		padding: 0 30rpx;
		box-sizing: border-box;
	}
	.btn{
		width: 200rpx;
		height: 66rpx;
		border-radius: 40rpx;
		background-color: #008573;
		line-height: 66rpx;
		text-align: center;
		color: #FFFFFF;
	}
</style>
